Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul CLI documentation and aesthetics #2703

Merged
merged 28 commits into from
Mar 6, 2023

Conversation

ThomasLaPiana
Copy link
Contributor

@ThomasLaPiana ThomasLaPiana commented Feb 25, 2023

Closes #2702
Closes #2704

Code Changes

  • add rich-click to requirements
  • update imports
  • add a file for tweaking formatting and update colors
  • add a new CLI command for viewing your local credentials file
  • take a pass at updating config documentation. The list of top-level commands to keep track of:
    • annotate
    • db
    • delete
    • deploy
    • evaluate
    • export
    • generate
    • get
    • init
    • ls
    • parse
    • pull
    • push
    • scan
    • status
    • user
    • view
    • webserver
    • worker
    • Options and arguments in options.py
    • top-level fides -h
  • open a follow-up issue to discuss overall CLI design, there are some things here that don't feel great as a user: Redesign the CLI usage/design pattern #2718

Steps to Confirm

  • autogenerated CLI docs still work
  • no visual wonkiness is detected
  • run fides view credentials, confirm failure (no file)
  • run fides user login, do the thing, then fides view credentials and verify the output

Pre-Merge Checklist

Description Of Changes

The aesthetics of the UI did not spark joy, so the rich_click package was added as a drop-in replacement to click that gives us great aesthetics for free while also being highly customizable.

An important note is that as part of this change, all help text rendered by the CLI will be assumed to be Markdown

@ThomasLaPiana ThomasLaPiana self-assigned this Feb 25, 2023
@cypress
Copy link

cypress bot commented Feb 25, 2023

Passing run #628 ↗︎

0 3 0 0 Flakiness 0

Details:

Merge ad2f7dc into 26e9091...
Project: fides Commit: 534638898a ℹ️
Status: Passed Duration: 00:36 💡
Started: Mar 6, 2023 5:13 AM Ended: Mar 6, 2023 5:14 AM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@codecov
Copy link

codecov bot commented Feb 25, 2023

Codecov Report

Patch coverage: 95.61% and project coverage change: +0.14 🎉

Comparison is base (26e9091) 86.60% compared to head (ad2f7dc) 86.75%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2703      +/-   ##
==========================================
+ Coverage   86.60%   86.75%   +0.14%     
==========================================
  Files         290      291       +1     
  Lines       16242    16312      +70     
  Branches     2065     2066       +1     
==========================================
+ Hits        14066    14151      +85     
+ Misses       1793     1777      -16     
- Partials      383      384       +1     
Impacted Files Coverage Δ
src/fides/cli/commands/view.py 83.87% <81.25%> (-5.02%) ⬇️
src/fides/cli/commands/crud.py 95.23% <83.33%> (+1.12%) ⬆️
src/fides/cli/__init__.py 92.15% <100.00%> (+0.15%) ⬆️
src/fides/cli/cli_formatting.py 100.00% <100.00%> (ø)
src/fides/cli/commands/annotate.py 86.66% <100.00%> (ø)
src/fides/cli/commands/core.py 92.06% <100.00%> (ø)
src/fides/cli/commands/db.py 81.48% <100.00%> (ø)
src/fides/cli/commands/export.py 100.00% <100.00%> (ø)
src/fides/cli/commands/generate.py 86.36% <100.00%> (ø)
src/fides/cli/commands/scan.py 88.46% <100.00%> (ø)
... and 7 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ThomasLaPiana
Copy link
Contributor Author

ThomasLaPiana commented Feb 25, 2023

little demo of what this looks like

image

@ThomasLaPiana ThomasLaPiana changed the title Replace click with `rich_click Replace click with rich_click Feb 25, 2023
@ThomasLaPiana ThomasLaPiana changed the title Replace click with rich_click Overhaul CLI documentation and aesthetics Feb 25, 2023
@ThomasLaPiana
Copy link
Contributor Author

@SteveDMurphy do the export commands need to have the dry flag other than the datamap export?

@SteveDMurphy
Copy link
Contributor

@SteveDMurphy do the export commands need to have the dry flag other than the datamap export?

They were primarily added for running tests against the commands, we can probably revamp those to either check a temp directory that the file exists if we want to get rid of them? (overlap with ls now I imagine)

Separately, @sanders41 and I were discussing the value of keeping all of the export commands, potentially removing them as something else to maintain and being able to simplify the export datamap + custom fields stuff. Would be curious to hear your thoughts too!

Copy link
Contributor

@pattisdr pattisdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI docs formatting is 💯 . Just noted minor things as I experimented.

src/fides/cli/__init__.py Outdated Show resolved Hide resolved
src/fides/cli/commands/export.py Show resolved Hide resolved
src/fides/cli/commands/generate.py Outdated Show resolved Hide resolved
src/fides/cli/commands/view.py Show resolved Hide resolved
src/fides/cli/__init__.py Show resolved Hide resolved
src/fides/cli/options.py Outdated Show resolved Hide resolved
src/fides/cli/options.py Show resolved Hide resolved
src/fides/cli/options.py Show resolved Hide resolved
Copy link
Contributor

@TheAndrewJackson TheAndrewJackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these updates. Much more concise throughout. It's awesome that you're able to use markdown in the help copy. I'm not used to seeing it in the terminal.

I found one instance of missing markdown formatting. Picture below:

Screenshot 2023-03-01 at 19 41 59

src/fides/cli/__init__.py Show resolved Hide resolved
src/fides/cli/commands/generate.py Outdated Show resolved Hide resolved
src/fides/cli/options.py Outdated Show resolved Hide resolved
@ThomasLaPiana ThomasLaPiana marked this pull request as ready for review March 2, 2023 05:33
@ThomasLaPiana
Copy link
Contributor Author

@SteveDMurphy do the export commands need to have the dry flag other than the datamap export?

They were primarily added for running tests against the commands, we can probably revamp those to either check a temp directory that the file exists if we want to get rid of them? (overlap with ls now I imagine)

Separately, @sanders41 and I were discussing the value of keeping all of the export commands, potentially removing them as something else to maintain and being able to simplify the export datamap + custom fields stuff. Would be curious to hear your thoughts too!

I have thoughts on the entire CLI design, but export did stick out as something that confused me, which means there's a high likelihood it would confuse users too. I'll follow this up in the other issue for CLI design #2718

@ThomasLaPiana
Copy link
Contributor Author

ThomasLaPiana commented Mar 2, 2023

Patch coverage is down but overall coverage is up. Testing the remaining patch pieces is not worth it from a time perspective (and complexity of testing those specific pieces) in my opinion

@ThomasLaPiana ThomasLaPiana changed the title Overhaul CLI documentation and aesthetics [Do Not Merge] Overhaul CLI documentation and aesthetics Mar 2, 2023
@ThomasLaPiana ThomasLaPiana changed the title [Do Not Merge] Overhaul CLI documentation and aesthetics Overhaul CLI documentation and aesthetics Mar 3, 2023
@ThomasLaPiana ThomasLaPiana merged commit 987b05b into main Mar 6, 2023
@ThomasLaPiana ThomasLaPiana deleted the ThomasLaPiana-add-rich-click branch March 6, 2023 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a command to view the local credentials file Use rich_click instead of click
4 participants